/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package lab9;
/**
*
* @author mweya
*/
public class Second extends Thread{
@Override
public void run() {
String[] names = {"John","Jane","Jon't", "Jo-Anne","Joe","James","Jamison","Jeremy","Jerome","Janice"};
try{
int j = 0;
while (j<names.length){
System.out.println(names[j]);
j++;
}
Thread.sleep(5000);
}
// The name of the exception is e and the type is InterruptedException
catch(InterruptedException e) {
System.err.println(e.toString());
}
}
}